/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = frmem_ncx.h                                        */
/*  NOTE      =                                                    */
/*  DATE      = 2014/09/29 by yaohl                                */
/*******************************************************************/

#ifndef __FRMEM_NCX_H_
#define __FRMEM_NCX_H_

#include "frmem_cfg.h"

/* 共享内存池 */
#if FR_MEM_POOL
    int  __fr_slab_init(size_t s_size, const char *p_slab_name);
    void __fr_slab_stat(char **pp_outbuff);
    void __fr_slab_destroy(void);

    #define __frcomm_slab_init(x, y)    __fr_slab_init(x, y)
    #define __frcomm_slab_stat(x)       __fr_slab_stat(x)
    #define __frcomm_slab_destroy()     __fr_slab_destroy()

    void *__fr_slab_malloc(size_t s_size);
    void *__fr_slab_memdup(const char *p_src, size_t s_size);
    char *__fr_slab_strdup(const char *p_src);
    void  __fr_slab_free(void *p_free_data);

    #define __frcomm_malloc(x)       __fr_slab_malloc(x)
    //#define __frcomm_malloc2(x,y)    __fr_slab_malloc(x)
    #define __frcomm_strdup(x)       __fr_slab_strdup(x)
    #define __frcomm_memdup(x,y)     __fr_slab_memdup(x, y)
    #define __frcomm_free(x)         __fr_slab_free(x)
#endif

#endif

